.tab {
  display: flex;
  align-items: center;
  height: 100%;
  background-color: var(--tab-bg);
  color: var(--tab-color);
  cursor: pointer;
  padding: 4px 12px;
  box-sizing: border-box;
  white-space: nowrap;
  position: relative;
  max-width: 200px;

  &::after {
    content: '';
    position: absolute;
    top: 2px;
    right: 3px;
    bottom: 3px;
    left: 2px;
    border: var(--tab-border);
    clip-path: var(--border-window-clip-path);
  }

  &:hover::after {
    border: var(--tab-hover-border);
  }

  & > span {
    display: inline-block;
    height: auto;
  }

  & > .editor-tab-icon {
    display: inline-block;
    flex-shrink: 0;
    height: 12px;
    width: 12px;
    margin-right: 8px;
    background-color: var(--tab-icon-color);
    -webkit-mask-size: 12px;

    &.livechat {
      -webkit-mask: url('../../../media/ic_bot_explorer.svg') no-repeat;
    }

    &.settings {
      -webkit-mask: url('../../../media/ic_settings.svg') no-repeat;
    }

    &.generic {
      -webkit-mask: url('../../../media/ic_bot_framework.svg') no-repeat;
      background-color: #007ACC;
    }
  }

  &:hover {
    > .editor-tab-close {
      opacity: 1;
    }
  }

  & > .editor-tab-close {
    text-decoration: none;
    display: inline-block;
    height: 17px;
    width: 17px;
    margin-left: 8px;
    background-color: transparent;
    border: 1px solid transparent;
    outline: none;
    opacity: 0;
    padding: 0;
    cursor: pointer;

    &:focus {
      border: var(--tab-focus-border);
      opacity: 1;
    }

    & > span {
      -webkit-mask: url('../../../media/ic_close.svg');
      display: block;
      height: 16px;
      width: 16px;
      background-color: var(--tab-icon-color);
    }
  }
}

.truncated-tab-text {
  max-width: 200px;
}

.dragged-over-editor-tab {
  background-color: var(--tab-active-tab-bg);
}

.active-editor-tab {
  background-color: var(--tab-active-tab-bg);
  color: var(--tab-color);

  & > .editor-tab-close {
    opacity: 1;
  }

  /** Should only be visible on high contrast */
  &::after {
    border: var(--tab-active-tab-inner-border);
  }
}

.tab-focus-target {
  position: absolute;
  top: 1px;
  left: 1px;
  right: 1px;
  bottom: 1px;
}

.tab-separator {
  position: absolute;
  width: 1px;
  top: 0;
  bottom: 0;
  right: 0;
  background-color: var(--tab-separator-bg);
}
